import Vue from 'vue'
import Vuex from 'vuex'

import home from './modules/home.js'
import search from './modules/search.js'
import detail from './modules/detail.js'
import cart from './modules/cart.js'
import login from './modules/login.js'
import register from './modules/register.js'

Vue.use(Vuex)

export default new Vuex.Store({
  modules: {
    home,
    search,
    detail,
    cart,
    login,
    register
  },
  getters: {
    loginName: state => state.login.userInfo.loginName
  }
})
